package cn.wolfcode.postbar.web.controller;

import cn.wolfcode.postbar.annotation.RequiredLogin;
import cn.wolfcode.postbar.domain.Postbar;
import cn.wolfcode.postbar.service.IPostbarService;
import cn.wolfcode.postbar.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/postbars")
public class PostbarController {

    @Autowired
    private IPostbarService postbarService;

    @RequiredLogin
    @GetMapping("/list")
    public Object list(){
        List<Postbar> list = postbarService.list();
        return JsonResult.success(list);
    }
}